<template>
    <view>
        <!-- <Navbar :hideBtn="true" title="设置" bgColor="#fff" :h5Show="false" :fixed="false"></Navbar> -->
        
        <view class="warp">
            <u-cell-group>
                <u-cell icon="lock-open" title="登录密码" isLink="true" @click="resetPassword = true"></u-cell>
                <u-cell icon="fingerprint" title="指纹密码" isLink="true"></u-cell>
                <u-cell icon="fingerprint" title="手势密码" isLink="true"></u-cell>
                <u-cell icon="phone" title="联系我们" isLink="true"></u-cell>
            </u-cell-group>
            
            <view style="margin-top: 100rpx;">
                <u-button text="退出" type="error" @click="logout"></u-button>
            </view>
        </view>
        
        
        
        
        <Password :show="resetPassword" @close="resetPassword = false"></Password>
        
    </view>
    
</template>

<script>
    
    import Navbar from '@/components/navbar/Navbar'
    import Gap from '@/components/gap/Gap'
    import Password from './password.vue'
    
    export default {
        components: {
          Navbar,
          Gap,
          Password,
        },
        data() {
            return {
                resetPassword: false,
                windowHeight: null,
                windowWidth: null
            };
        },
        created() {
            this.getSystemInfo();
        }, 
        methods: {
            getSystemInfo() {
                uni.getSystemInfo({
                    success: function (info) {
                        console.log('屏幕的高度：' + info.windowHeight);
                        console.log('屏幕的宽度：' + info.windowWidth);
                        this.windowHeight = info.windowHeight;
                        this.windowWidth = info.windowWidth;
                    }
                });
            },
            logout() {
                const app = this
                app.$store.dispatch('Logout').then(res => {
                    uni.reLaunch({
                      url: '/pages/login/index'
                    })
                })
            }
        },
    }
</script>

<style lang="scss">
    .warp {
        padding: 0 30rpx;
    }
</style>
